using System;
using System.Collections;
using System.Text;
using System.Configuration;
using System.Xml;

namespace CRMDocumentation
{
    public class ConfigHandler : ConfigurationSection
    {
        public ConfigHandler()
        {
        }

        [ConfigurationProperty("Entity")]
        public EntityConfigElement Entity
        {
            get
            { return (EntityConfigElement)this["Entity"]; }
            set
            { this["Entity"] = value; }
        }
    }

    public class EntityConfigElement : ConfigurationElement
    {
        public EntityConfigElement()
        {
        }

        public EntityConfigElement(String _entityname, bool _process)
        {
            EntityName = _entityname;
            Process = _process;
        }

        [ConfigurationProperty("EntityName", DefaultValue = "Account", IsRequired = true)]
        [StringValidator(InvalidCharacters = "~!@#$%^&*()[]{}/;'\"|\\", MinLength = 1, MaxLength = 60)]
        public String EntityName
        {
            get
            { return (String)this["EntityName"]; }
            set
            { this["EntityName"] = value; }
        }

        [ConfigurationProperty("Process", DefaultValue = true, IsRequired = true)]
        public bool Process
        {
            get
            { return (bool)this["Process"]; }
            set
            { this["Process"] = value; }
        }
    }
}
